package com.qfedu.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qfedu.entity.Course;
import com.qfedu.entity.Depart;
import com.qfedu.entity.GroupDepartData;
import com.qfedu.entity.ResponseData;
import com.qfedu.service.DepartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DepartController {

    @Autowired
    private DepartService departService;

    @RequestMapping("/groupByDept.do")
    public ResponseData  getCountByDepart(){

        ResponseData responseData = new ResponseData();

        GroupDepartData groupDepartData =  departService.getCountByDepart();

        responseData.setCode(0);
        responseData.setMsg("success");
        responseData.setData(groupDepartData);

        return responseData;
    }

}
